"4.0.2";
(function(q,x,H,K){"undefined"==typeof q.easyXDM&&function(a,b,d,e,k,g){function r(c,f){var h=typeof c[f];return"function"==h||!("object"!=h||!c[f])||"unknown"==h}function C(){if(!J(H.plugins)&&"object"==typeof H.plugins["Shockwave Flash"]){var c=H.plugins["Shockwave Flash"].description;c&&!J(H.mimeTypes)&&H.mimeTypes["application/x-shockwave-flash"]&&H.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(T=c.match(/\d+/g))}if(!T)try{var f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");T=
Array.prototype.slice.call(f.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/),1)}catch(h){}if(!T)return!1;c=parseInt(T[0],10);f=parseInt(T[1],10);ca=9<c&&0<f;return!0}function E(){if(!U){U=!0;for(var c=0;c<Y.length;c++)Y[c]();Y.length=0}}function D(c,f){U?c.call(f):Y.push(function(){c.call(f)})}function N(){var c=parent;if(""!==W)for(var f=0,h=W.split(".");f<h.length;f++)c=c[h[f]];return c.easyXDM}function G(c){var f=c.toLowerCase().match(Z);c=f[2];var h=f[3];f=f[4]||"";if("http:"==c&&":80"==
f||"https:"==c&&":443"==f)f="";return c+"//"+h+f}function Q(c){c=c.replace(pa,"$1/");if(!c.match(/^(http||https):\/\//)){var f="/"===c.substring(0,1)?"":d.pathname;"/"!==f.substring(f.length-1)&&(f=f.substring(0,f.lastIndexOf("/")+1));c=d.protocol+"//"+d.host+f+c}for(;ha.test(c);)c=c.replace(ha,"");return c}function O(c,f){var h="",l=c.indexOf("#");-1!==l&&(h=c.substring(l),c=c.substring(0,l));l=[];for(var p in f)f.hasOwnProperty(p)&&l.push(p+"="+g(f[p]));return c+(ia?"#":-1==c.indexOf("?")?"?":"&")+
l.join("&")+h}function J(c){return"undefined"===typeof c}function I(c,f,h){var l;for(l in f)if(f.hasOwnProperty(l))if(l in c){var p=f[l];"object"===typeof p?I(c[l],p,h):h||(c[l]=f[l])}else c[l]=f[l];return c}function R(c){if(J(aa)){var f=b.body.appendChild(b.createElement("form")),h=f.appendChild(b.createElement("input"));h.name=M+"TEST"+ja;aa=h!==f.elements[h.name];b.body.removeChild(f)}aa?f=b.createElement('<iframe name="'+c.props.name+'"/>'):(f=b.createElement("IFRAME"),f.name=c.props.name);f.id=
f.name=c.props.name;delete c.props.name;"string"==typeof c.container&&(c.container=b.getElementById(c.container));c.container||(I(f.style,{position:"absolute",top:"-2000px",left:"0px"}),c.container=b.body);h=c.props.src;c.props.src="javascript:false";I(f,c.props);f.border=f.frameBorder=0;f.allowTransparency=!0;c.container.appendChild(f);c.onLoad&&P(f,"load",c.onLoad);if(c.usePost){var l=c.container.appendChild(b.createElement("form"));l.target=f.name;l.action=h;l.method="POST";if("object"===typeof c.usePost)for(var p in c.usePost)if(c.usePost.hasOwnProperty(p)){if(aa)var n=
b.createElement('<input name="'+p+'"/>');else n=b.createElement("INPUT"),n.name=p;n.value=c.usePost[p];l.appendChild(n)}l.submit();l.parentNode.removeChild(l)}else f.src=h;c.props.src=h;return f}function ka(c){var f=c.protocol;c.isHost=c.isHost||J(L.xdm_p);ia=c.hash||!1;c.props||(c.props={});if(c.isHost)c.remote=Q(c.remote),c.channel=c.channel||"default"+ja++,c.secret=Math.random().toString(16).substring(2),J(f)&&(f=G(d.href)==G(c.remote)?"4":r(a,"postMessage")||r(b,"postMessage")?"1":c.swf&&r(a,
"ActiveXObject")&&C()?"6":"Gecko"===H.product&&"frameElement"in a&&-1==H.userAgent.indexOf("WebKit")?"5":c.remoteHelper?"2":"0");else{c.channel=L.xdm_c.replace(/["'<>\\]/g,"");c.secret=L.xdm_s;c.remote=L.xdm_e.replace(/["'<>\\]/g,"");f=L.xdm_p;var h;if(h=c.acl){a:{h=c.acl;var l=c.remote;"string"==typeof h&&(h=[h]);for(var p,n=h.length;n--;)if(p=h[n],p=new RegExp("^"==p.substr(0,1)?p:"^"+p.replace(/(\*)/g,".$1").replace(/\?/g,".")+"$"),p.test(l)){h=!0;break a}h=!1}h=!h}if(h)throw Error("Access denied for "+
c.remote);}c.protocol=f;switch(f){case "0":I(c,{interval:100,delay:2E3,useResize:!0,useParent:!1,usePolling:!1},!0);if(c.isHost){if(!c.local){f=d.protocol+"//"+d.host;var m=b.body.getElementsByTagName("img");for(l=m.length;l--;)if(h=m[l],h.src.substring(0,f.length)===f){c.local=h.src;break}c.local||(c.local=a)}f={xdm_c:c.channel,xdm_p:0};c.local===a?(c.usePolling=!0,c.useParent=!0,c.local=d.protocol+"//"+d.host+d.pathname+d.search,f.xdm_e=c.local,f.xdm_pa=1):f.xdm_e=Q(c.local);c.container&&(c.useResize=
!1,f.xdm_po=1);c.remote=O(c.remote,f)}else I(c,{channel:L.xdm_c,remote:L.xdm_e,useParent:!J(L.xdm_pa),usePolling:!J(L.xdm_po),useResize:c.useParent?!1:c.useResize});m=[new u.stack.HashTransport(c),new u.stack.ReliableBehavior({}),new u.stack.QueueBehavior({encode:!0,maxLength:4E3-c.remote.length}),new u.stack.VerifyBehavior({initiate:c.isHost})];break;case "1":m=[new u.stack.PostMessageTransport(c)];break;case "2":c.isHost&&(c.remoteHelper=Q(c.remoteHelper));m=[new u.stack.NameTransport(c),new u.stack.QueueBehavior,
new u.stack.VerifyBehavior({initiate:c.isHost})];break;case "3":m=[new u.stack.NixTransport(c)];break;case "4":m=[new u.stack.SameOriginTransport(c)];break;case "5":m=[new u.stack.FrameElementTransport(c)];break;case "6":T||C(),m=[new u.stack.FlashTransport(c)]}m.push(new u.stack.QueueBehavior({lazy:c.lazy,remove:!0}));return m}function la(c){for(var f,h={incoming:function(n,m){this.up.incoming(n,m)},outgoing:function(n,m){this.down.outgoing(n,m)},callback:function(n){this.up.callback(n)},init:function(){this.down.init()},
destroy:function(){this.down.destroy()}},l=0,p=c.length;l<p;l++)f=c[l],I(f,h,!0),0!==l&&(f.down=c[l-1]),l!==p-1&&(f.up=c[l+1]);return f}function qa(c){c.up.down=c.down;c.down.up=c.up;c.up=c.down=null}var ba=this,ja=Math.floor(1E4*Math.random()),da=Function.prototype,Z=/^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/,ha=/[\-\w]+\/\.\.\//,pa=/([^:])\/\//g,W="",u={},ra=a.easyXDM,M="easyXDM_",aa,ia=!1,T,ca;if(r(a,"addEventListener")){var P=function(c,f,h){c.addEventListener(f,h,!1)};var X=function(c,f,h){c.removeEventListener(f,
h,!1)}}else if(r(a,"attachEvent"))P=function(c,f,h){c.attachEvent("on"+f,h)},X=function(c,f,h){c.detachEvent("on"+f,h)};else throw Error("Browser not supported");var U=!1,Y=[];if("readyState"in b){var ea=b.readyState;U="complete"==ea||~H.userAgent.indexOf("AppleWebKit/")&&("loaded"==ea||"interactive"==ea)}else U=!!b.body;if(!U){if(r(a,"addEventListener"))P(b,"DOMContentLoaded",E);else if(P(b,"readystatechange",function(){"complete"==b.readyState&&E()}),b.documentElement.doScroll&&a===top){var ma=
function(){if(!U){try{b.documentElement.doScroll("left")}catch(c){e(ma,1);return}E()}};ma()}P(a,"load",E)}var L=function(c){c=c.substring(1).split("&");for(var f={},h,l=c.length;l--;)h=c[l].split("="),f[h[0]]=k(h[1]);return f}(/xdm_e=/.test(d.search)?d.search:d.hash),fa=function(){var c={},f={a:[1,2,3]};if("undefined"!=typeof JSON&&"function"===typeof JSON.stringify&&'{"a":[1,2,3]}'===JSON.stringify(f).replace(/\s/g,""))return JSON;Object.toJSON&&'{"a":[1,2,3]}'===Object.toJSON(f).replace(/\s/g,"")&&
(c.stringify=Object.toJSON);"function"===typeof String.prototype.evalJSON&&(f='{"a":[1,2,3]}'.evalJSON(),f.a&&3===f.a.length&&3===f.a[2]&&(c.parse=function(h){return h.evalJSON()}));return c.stringify&&c.parse?(fa=function(){return c},c):null};I(u,{version:"2.4.19.0",query:L,stack:{},apply:I,getJSONObject:fa,whenReady:D,noConflict:function(c){a.easyXDM=ra;(W=c)&&(M="easyXDM_"+W.replace(".","_")+"_");return u}});u.DomHelper={on:P,un:X,requiresJSON:function(c){"object"==typeof a.JSON&&a.JSON||b.write('<script type="text/javascript" src="'+
c+'">\x3c/script>')}};(function(){var c={};u.Fn={set:function(f,h){c[f]=h},get:function(f,h){if(c.hasOwnProperty(f)){var l=c[f];h&&delete c[f];return l}}}})();u.Socket=function(c){var f=la(ka(c).concat([{incoming:function(l,p){c.onMessage(l,p)},callback:function(l){if(c.onReady)c.onReady(l)}}])),h=G(c.remote);this.origin=G(c.remote);this.destroy=function(){f.destroy()};this.postMessage=function(l){f.outgoing(l,h)};f.init()};u.Rpc=function(c,f){if(f.local)for(var h in f.local)if(f.local.hasOwnProperty(h)){var l=
f.local[h];"function"===typeof l&&(f.local[h]={method:l})}var p=la(ka(c).concat([new u.stack.RpcBehavior(this,f),{callback:function(n){if(c.onReady)c.onReady(n)}}]));this.origin=G(c.remote);this.destroy=function(){p.destroy()};p.init()};u.stack.SameOriginTransport=function(c){var f,h,l,p;return f={outgoing:function(n,m,v){l(n);v&&v()},destroy:function(){h&&(h.parentNode.removeChild(h),h=null)},onDOMReady:function(){p=G(c.remote);c.isHost?(I(c.props,{src:O(c.remote,{xdm_e:d.protocol+"//"+d.host+d.pathname,
xdm_c:c.channel,xdm_p:4}),name:M+c.channel+"_provider"}),h=R(c),u.Fn.set(c.channel,function(n){l=n;e(function(){f.up.callback(!0)},0);return function(m){f.up.incoming(m,p)}})):(l=N().Fn.get(c.channel)(function(n){f.up.incoming(n,p)}),e(function(){f.up.callback(!0)},0))},init:function(){D(f.onDOMReady,f)}}};u.stack.FlashTransport=function(c){function f(w,t){e(function(){l.up.incoming(w,n)},0)}function h(w){var t=c.swf+"?host="+c.isHost,y="easyXDM_swf_"+Math.floor(1E4*Math.random());u.Fn.set("flash_loaded"+
w.replace(/[\-.]/g,"_"),function(){u.stack.FlashTransport[w].swf=m=v.firstChild;for(var A=u.stack.FlashTransport[w].queue,z=0;z<A.length;z++)A[z]();A.length=0});c.swfContainer?v="string"==typeof c.swfContainer?b.getElementById(c.swfContainer):c.swfContainer:(v=b.createElement("div"),I(v.style,ca&&c.swfNoThrottle?{height:"20px",width:"20px",position:"fixed",right:0,top:0}:{height:"1px",width:"1px",position:"absolute",overflow:"hidden",right:0,top:0}),b.body.appendChild(v));var B="callback=flash_loaded"+
g(w.replace(/[\-.]/g,"_"))+"&proto="+ba.location.protocol+"&domain="+g(ba.location.href.match(Z)[3])+"&port="+g(ba.location.href.match(Z)[4]||"")+"&ns="+g(W);v.innerHTML="<object height='20' width='20' type='application/x-shockwave-flash' id='"+y+"' data='"+t+"'><param name='allowScriptAccess' value='always'></param><param name='wmode' value='transparent'><param name='movie' value='"+t+"'></param><param name='flashvars' value='"+B+"'></param><embed type='application/x-shockwave-flash' FlashVars='"+
B+"' allowScriptAccess='always' wmode='transparent' src='"+t+"' height='1' width='1'></embed></object>"}var l,p,n,m,v;return l={outgoing:function(w,t,y){m.postMessage(c.channel,w.toString());y&&y()},destroy:function(){try{m.destroyChannel(c.channel)}catch(w){}m=null;p&&(p.parentNode.removeChild(p),p=null)},onDOMReady:function(){n=c.remote;u.Fn.set("flash_"+c.channel+"_init",function(){e(function(){l.up.callback(!0)})});u.Fn.set("flash_"+c.channel+"_onMessage",f);c.swf=Q(c.swf);var w=c.swf.match(Z)[3],
t=function(){u.stack.FlashTransport[w].init=!0;m=u.stack.FlashTransport[w].swf;m.createChannel(c.channel,c.secret,G(c.remote),c.isHost);c.isHost&&(ca&&c.swfNoThrottle&&I(c.props,{position:"fixed",right:0,top:0,height:"20px",width:"20px"}),I(c.props,{src:O(c.remote,{xdm_e:G(d.href),xdm_c:c.channel,xdm_p:6,xdm_s:c.secret}),name:M+c.channel+"_provider"}),p=R(c))};u.stack.FlashTransport[w]&&u.stack.FlashTransport[w].init?t():u.stack.FlashTransport[w]?u.stack.FlashTransport[w].queue.push(t):(u.stack.FlashTransport[w]=
{queue:[t]},h(w))},init:function(){D(l.onDOMReady,l)}}};u.stack.PostMessageTransport=function(c){function f(m){if(m.origin)var v=G(m.origin);else if(m.uri)v=G(m.uri);else if(m.domain)v=d.protocol+"//"+m.domain;else throw"Unable to retrieve the origin of the event";v==n&&m.data&&m.data.substring&&m.data.substring(0,c.channel.length+1)==c.channel+" "&&h.up.incoming(m.data.substring(c.channel.length+1),v)}var h,l,p,n;return h={outgoing:function(m,v,w){p.postMessage(c.channel+" "+m,v||n);w&&w()},destroy:function(){X(a,
"message",f);l&&(p=null,l.parentNode.removeChild(l),l=null)},onDOMReady:function(){n=G(c.remote);if(c.isHost){var m=function(v){v.data==c.channel+"-ready"&&(p="postMessage"in l.contentWindow?l.contentWindow:l.contentWindow.document,X(a,"message",m),P(a,"message",f),e(function(){h.up.callback(!0)},0))};P(a,"message",m);I(c.props,{src:O(c.remote,{xdm_e:G(d.href),xdm_c:c.channel,xdm_p:1}),name:M+c.channel+"_provider"});l=R(c)}else P(a,"message",f),p="postMessage"in a.parent?a.parent:a.parent.document,
p.postMessage(c.channel+"-ready",n),e(function(){h.up.callback(!0)},0)},init:function(){D(h.onDOMReady,h)}}};u.stack.FrameElementTransport=function(c){var f,h,l,p;return f={outgoing:function(n,m,v){l.call(this,n);v&&v()},destroy:function(){h&&(h.parentNode.removeChild(h),h=null)},onDOMReady:function(){p=G(c.remote);c.isHost?(I(c.props,{src:O(c.remote,{xdm_e:G(d.href),xdm_c:c.channel,xdm_p:5}),name:M+c.channel+"_provider"}),h=R(c),h.fn=function(n){delete h.fn;l=n;e(function(){f.up.callback(!0)},0);
return function(m){f.up.incoming(m,p)}}):(b.referrer&&G(b.referrer)!=L.xdm_e&&(a.top.location=L.xdm_e),l=a.frameElement.fn(function(n){f.up.incoming(n,p)}),f.up.callback(!0))},init:function(){D(f.onDOMReady,f)}}};u.stack.NameTransport=function(c){function f(z){v.contentWindow.sendMessage(z,c.remoteHelper+(m?"#_3":"#_2")+c.channel)}function h(){m?2!==++t&&m||n.up.callback(!0):(f("ready"),n.up.callback(!0))}function l(z){n.up.incoming(z,B)}function p(){y&&e(function(){y(!0)},0)}var n,m,v,w,t,y,B,A;
return n={outgoing:function(z,F,V){y=V;f(z)},destroy:function(){v.parentNode.removeChild(v);v=null;m&&(w.parentNode.removeChild(w),w=null)},onDOMReady:function(){m=c.isHost;t=0;B=G(c.remote);c.local=Q(c.local);m?(u.Fn.set(c.channel,function(F){m&&"ready"===F&&(u.Fn.set(c.channel,l),h())}),A=O(c.remote,{xdm_e:c.local,xdm_c:c.channel,xdm_p:2}),I(c.props,{src:A+"#"+c.channel,name:M+c.channel+"_provider"}),w=R(c)):(c.remoteHelper=c.remote,u.Fn.set(c.channel,l));var z=function(){var F=v||this;X(F,"load",
z);u.Fn.set(c.channel+"_load",p);(function S(){"function"==typeof F.contentWindow.sendMessage?h():e(S,50)})()};v=R({props:{src:c.local+"#_4"+c.channel},onLoad:z})},init:function(){D(n.onDOMReady,n)}}};u.stack.HashTransport=function(c){function f(){if(w){var A=w.location.href,z="",F=A.indexOf("#");-1!=F&&(z=A.substring(F));z&&z!=m&&(m=z,h.up.incoming(m.substring(m.indexOf("_")+1),B))}}var h,l,p,n,m,v,w,t,y,B;return h={outgoing:function(A,z){if(t){var F=c.remote+"#"+v++ +"_"+A;(l||!y?t.contentWindow:
t).location=F}},destroy:function(){a.clearInterval(p);!l&&y||t.parentNode.removeChild(t);t=null},onDOMReady:function(){l=c.isHost;n=c.interval;m="#"+c.channel;v=0;y=c.useParent;B=G(c.remote);if(l){I(c.props,{src:c.remote,name:M+c.channel+"_provider"});if(y)c.onLoad=function(){w=a;p=setInterval(f,n);h.up.callback(!0)};else{var A=0,z=c.delay/50;(function V(){if(++A>z)throw Error("Unable to reference listenerwindow");try{w=t.contentWindow.frames[M+c.channel+"_consumer"]}catch(S){}w?(p=setInterval(f,
n),h.up.callback(!0)):e(V,50)})()}t=R(c)}else w=a,p=setInterval(f,n),y?(t=parent,h.up.callback(!0)):(I(c,{props:{src:c.remote+"#"+c.channel+new Date,name:M+c.channel+"_consumer"},onLoad:function(){h.up.callback(!0)}}),t=R(c))},init:function(){D(h.onDOMReady,h)}}};u.stack.ReliableBehavior=function(c){var f,h,l=0,p=0,n="";return f={incoming:function(m,v){var w=m.indexOf("_"),t=m.substring(0,w).split(",");m=m.substring(w+1);t[0]==l&&(n="",h&&h(!0));0<m.length&&(f.down.outgoing(t[1]+","+l+"_"+n,v),p!=
t[1]&&(p=t[1],f.up.incoming(m,v)))},outgoing:function(m,v,w){n=m;h=w;f.down.outgoing(p+","+ ++l+"_"+m,v)}}};u.stack.QueueBehavior=function(c){function f(){if(c.remove&&0===l.length)qa(h);else if(!p&&0!==l.length&&!m){p=!0;var y=l.shift();h.down.outgoing(y.data,y.origin,function(B){p=!1;y.callback&&e(function(){y.callback(B)},0);f()})}}var h,l=[],p=!0,n="",m,v=0,w=!1,t=!1;return h={init:function(){J(c)&&(c={});c.maxLength&&(v=c.maxLength,t=!0);c.lazy?w=!0:h.down.init()},callback:function(y){p=!1;var B=
h.up;f();B.callback(y)},incoming:function(y,B){if(t){var A=y.indexOf("_"),z=parseInt(y.substring(0,A),10);n+=y.substring(A+1);0===z&&(c.encode&&(n=k(n)),h.up.incoming(n,B),n="")}else h.up.incoming(y,B)},outgoing:function(y,B,A){c.encode&&(y=g(y));var z=[];if(t){for(;0!==y.length;){var F=y.substring(0,v);y=y.substring(F.length);z.push(F)}for(;F=z.shift();)l.push({data:z.length+"_"+F,origin:B,callback:0===z.length?A:null})}else l.push({data:y,origin:B,callback:A});w?h.down.init():f()},destroy:function(){m=
!0;h.down.destroy()}}};u.stack.VerifyBehavior=function(c){function f(){l=Math.random().toString(16).substring(2);h.down.outgoing(l)}var h,l,p;return h={incoming:function(n,m){var v=n.indexOf("_");-1===v?n===l?h.up.callback(!0):p||(p=n,c.initiate||f(),h.down.outgoing(n)):n.substring(0,v)===p&&h.up.incoming(n.substring(v+1),m)},outgoing:function(n,m,v){h.down.outgoing(l+"_"+n,m,v)},callback:function(n){c.initiate&&f()}}};u.stack.RpcBehavior=function(c,f){function h(t){t.jsonrpc="2.0";n.down.outgoing(m.stringify(t))}
function l(t,y){var B=Array.prototype.slice;return function(){var A=arguments.length,z={method:y};if(0<A&&"function"===typeof arguments[A-1]){if(1<A&&"function"===typeof arguments[A-2]){var F={success:arguments[A-2],error:arguments[A-1]};z.params=B.call(arguments,0,A-2)}else F={success:arguments[A-1]},z.params=B.call(arguments,0,A-1);w[""+ ++v]=F;z.id=v}else z.params=B.call(arguments,0);t.namedParams&&1===z.params.length&&(z.params=z.params[0]);h(z)}}function p(t,y,B,A){if(B){if(y){var z=function(S){z=
da;h({id:y,result:S})};var F=function(S,na){F=da;var oa={id:y,error:{code:-32099,message:S}};na&&(oa.error.data=na);h(oa)}}else z=F=da;"[object Array]"!==Object.prototype.toString.call(A)&&(A=[A]);try{var V=B.method.apply(B.scope,A.concat([z,F]));J(V)||z(V)}catch(S){F(S.message)}}else y&&h({id:y,error:{code:-32601,message:"Procedure not found."}})}var n,m=f.serializer||fa(),v=0,w={};return n={incoming:function(t,y){var B=m.parse(t);if(B.method)f.handle?f.handle(B,h):p(B.method,B.id,f.local[B.method],
B.params);else{var A=w[B.id];B.error?A.error&&A.error(B.error):A.success&&A.success(B.result);delete w[B.id]}},init:function(){if(f.remote)for(var t in f.remote)f.remote.hasOwnProperty(t)&&(c[t]=l(f.remote[t],t));n.down.init()},destroy:function(){for(var t in f.remote)f.remote.hasOwnProperty(t)&&c.hasOwnProperty(t)&&delete c[t];n.down.destroy()}}};ba.easyXDM=u}(q,x,location,q.setTimeout,decodeURIComponent,encodeURIComponent);"undefined"!=typeof q.uLogin&&q.uLogin.uLoginHost||(Array.prototype.indexOf||
(Array.prototype.indexOf=function(a){try{for(var b=0;b<this.length;b++)if(this[b]==a)return b}catch(d){}return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),"undefined"===typeof q.console&&(q.console={log:function(){},error:function(){},info:function(){},assert:function(){}}),q.uLogin={uLoginHost:function(a){var b;for(b in a)if(b in a&&a[b].src&&/^https?:\/\/(.*?)\/js\/ulogin\.js/.test(a[b].src)){var d=a[b].src.match(/^https?:\/\/([^/]+)/)[1].replace(/^www\./,
"");break}return"u-login.com"===d?"u-login.com":"ulogin.ru"}(x.getElementsByTagName("script"))},q.uLogin={version:"4",protocol:location.href.match(/^https/i)?"https":"http",host:encodeURIComponent(location.host),uLoginHost:uLogin.uLoginHost,supportStorage:!!("localStorage"in window&&null!==window.localStorage&&"JSON"in window&&null!==window.JSON&&"undefined"!==typeof window.JSON.parse&&"undefined"!==typeof window.JSON.stringify),supportHistory:!(!window.history||!history.pushState),ids:[],timeouts:{},
listeners:{},lang:(H.language||H.systemLanguage||H.userLanguage||"en").substr(0,2).toLowerCase(),langs:"en ru uk fr de uz".split(" "),dialog:!1,close:!1,lightbox:!1,dialogSocket:!1,pixel:!1,providerCodes:[],providerNames:[],states:["ready","open","receive","close","fill"],indexedProviders:{vkontakte:{code:0,name:"VK"},odnoklassniki:{code:1,name:"Odnoklassniki"},mailru:{code:2,name:"Mail.ru"},facebook:{code:3,name:"Facebook"},google:{code:5,name:"Google"},yandex:{code:6,name:"Yandex"},livejournal:{code:7,
name:"LiveJournal"},liveid:{code:12,name:"LiveID"},soundcloud:{code:13,name:"SoundCloud"},steam:{code:14,name:"Steam"},youtube:{code:16,name:"YouTube"},foursquare:{code:17,name:"foursquare"}},themes:["classic","flat"],widgetSettings:{},findTimer:0,waitGetWidget:{},altwayCalled:[],rc:!1,page:null,altway:function(a){a=a.toLowerCase();return!!/iPhone|iPad/i.test(a)}(H.userAgent||H.vendor||q.opera),m:!!/(ip(ad|od|hone)|android)/i.test(H.userAgent||H.vendor||q.opera),mobile:function(a){if(/_utl_t=vk/.test(location.href)||
/_utl_t=vk/.test(document.referrer))return!1;a=a.toLowerCase();return!!/(ip(ad|od|hone)|android)/i.test(a)}(H.userAgent||H.vendor||q.opera),openFromSocket:!1,ppi:null,authSocket:!1,availableParams:{id:1,redirect_uri:1,page:1,callback:1,fields:1,force_fields:1,popup_css:1,optional:1,protocol:1,host:1,lang:1,verify:1,sort:1,othprov:1,providers:1,altway:1,m:1,icons_32:1,icons_16:1},cancelClick:!1,postMessageIsAvailable:"undefined"!==typeof q.postMessage,init:function(a){for(d in this.indexedProviders){var b=
this.indexedProviders[d];this.providerCodes[b.code]=d;this.providerNames[b.code]=b.name}window.__utl__ext__counters||(window.__utl__ext__counters=!0,function(k,g,r){(g[r]=g[r]||[]).push(function(){try{g.yaCounter82412725=new Ya.Metrika({id:82412725,clickmap:!1,trackLinks:!1,accurateTrackBounce:!0})}catch(D){}});var C=k.getElementsByTagName("script")[0],E=k.createElement("script");r=function(){C.parentNode.insertBefore(E,C)};E.type="text/javascript";E.async=!0;E.src=("https:"==k.location.protocol?
"https:":"http:")+"//mc.yandex.ru/metrika/watch.js";"[object Opera]"==g.opera?k.addEventListener("DOMContentLoaded",r,!1):r()}(document,window,"yandex_metrika_callbacks"));if(x.body){this.mobile&&(this.altway=!0);this.page=encodeURIComponent(location.href);this.openFromSocket&&(this.authSocket=this.initSocket(this.buildUrl("/version/3.0/html/buttons_receiver.html",{four:"",r:parseInt(1E5*Math.random())}),this.getRC(),{background:"transparent"}));""==a&&(a=x.getElementsByTagName("script"),a=a[a.length-
1].src,-1==a.indexOf("?")&&(a+="?"),a=a.substr(a.indexOf("?")+1));if(""!=a){var d=this.parse(a);d.version&&(this.version=d.version);if(d.display)if(b=d.id||"uLogin",this.get(b)){a=!0;for(var e=0;e<this.ids.length;e++)b==this.ids[e].id&&(a=!1);a&&this.setProp(d.id||"uLogin",this.ids.length,d)}else K('uLogin.init("'+a+'")',1E3)}this.add(x.body,"touchmove",this.touchMove);uLogin.timeouts.search_all=K(function g(){uLogin.findWidgets();if("complete"===x.readyState&&(0===uLogin.findTimer&&(uLogin.findTimer=
+new Date),1E4<new Date-uLogin.findTimer))return!1;uLogin.timeouts.all=K(g,50)},50);this.findWidgets();uLogin.timeouts.search_ulogin=K(function r(){uLogin.checkAsyncWidgets();uLogin.timeouts.search_ulogin=K(r,50)},50);this.checkAsyncWidgets();uLogin.timeouts.check_widgets=K(function C(){uLogin.checkCurrentWidgets();uLogin.timeouts.check_widgets=K(C,300)},30);this.checkCurrentWidgets();this.sendPixel();uLogin.postMessageIsAvailable&&(window.addEventListener?window.addEventListener("message",uLogin.onMessage):
window.attachEvent("onmessage",uLogin.onMessage))}else K(function(){uLogin.init()},20);this.callbackReceived()},onMessage:function(a){a.origin=="https://"+uLogin.uLoginHost&&a.data&&a.data.mine&&a.data.func&&("object"===typeof a.data.func&&(a.data.func=a.data.func[0]),"to_window"===a.data.func?(src=uLogin.buildUrl(a.data.args[2],{fields:a.data.args[0],filled:a.data.args[1],set:encodeURIComponent("{window:1}")}),console.log(src),uLogin.loadWindow(src)):q[a.data.func]&&q[a.data.func].apply(uLogin,a.data.args||
[]))},get:function(a){return x.getElementById(a)},exists:function(a){return"undefined"!=typeof a},add:function(a,b,d){a.addEventListener?a.addEventListener(b,function(e){"click"===b&&uLogin.cancelClick||d(a,e)},!1):a.attachEvent?a.attachEvent("on"+b,function(e){"click"===b&&uLogin.cancelClick||d(a,e)}):a["on"+b]=function(e){"click"===b&&uLogin.cancelClick||d(a,e)};"click"===b&&(this.add(a,"touchstart",this.touchStart),this.add(a,"touchend",function(e,k){return function(g,r){uLogin.cancelClick||(uLogin.cancelClick=
!0,k.call(this,e,r))}}(a,d)))},touchStart:function(){uLogin.cancelClick=!1},touchMove:function(){uLogin.cancelClick=!0},is_encoded:function(a){return decodeURIComponent(a)!=a},genID:function(){for(var a=new Date,b=a.getTime()+Math.floor(1E5*Math.random());this.get("ul_"+b);)b=a.getTime()+Math.floor(1E5*Math.random());return"ul_"+b},show:function(a){this.exists(a)&&(a.style.display="block")},hide:function(a){a&&this.exists(a)&&(a.style.display="none")},parse:function(a){var b={};if(!a)return b;if("object"===
typeof a)return a;var d=a.split("&");d=1<d.length?d:a.split(";");for(a=0;a<d.length;a++){var e=d[a].split("=");e[0]&&(e[0]=e[0].trim());e[1]&&(e[1]=e[1].trim());b[e[0]]=e[1]}return b},scrollTop:function(){return q.pageYOffset||x.documentElement.scrollTop||x.body.scrollTop},scrollLeft:function(){return q.pageXOffset||x.documentElement.scrollLeft||x.body.scrollLeft},dialogHeight:function(){return 358},dialogWidth:function(){return 564},clientWidth:function(){var a=0;"[object Opera]"==Object.prototype.toString.call(q.opera)&&
9.5>q.parseFloat(q.opera.version())?a=x.body.clientWidth:q.innerWidth&&(a=q.innerWidth);this.isIE()&&(a=x.documentElement.clientWidth);return a},clientHeight:function(){var a=0;"[object Opera]"==Object.prototype.toString.call(q.opera)&&9.5>q.parseFloat(q.opera.version())?a=x.body.clientHeight:q.innerHeight&&(a=q.innerHeight);this.isIE()&&(a=x.documentElement.clientHeight);return a},isIE:function(){if(/MSIE (\d+\.\d+);/.test(H.userAgent)){var a=Number(RegExp.$1);if(9>a)return a}return!1},getPPI:function(){if(null===
this.ppi)try{var a=window.devicePixelRatio||1,b=document.getElementsByTagName("body")[0],d=document.createElement("div");d.style="height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;";b.appendChild(d);var e=d.offsetWidth*a;b.removeChild(d);this.ppi=e}catch(k){this.ppi=96}return this.ppi},inArray:function(a,b){if(!a||!b)return!1;for(var d=0,e=b.length;d<e;d++)if(a==b[d])return d;return-1},findWidgets:function(){for(var a=0,b=[],d=[],e=x.getElementsByTagName("div"),k=x.getElementsByTagName("a");k[a];)k[a]&&
(b[a]=k[a]),a++;for(a=0;e[a];)e[a]&&(d[a]=e[a]),a++;for(a=0;d[a]||b[a];)d[a]&&this.addWidget(d[a]),b[a]&&this.addWidget(b[a]),a++},addWidget:function(a,b){var d=a.id,e=a.getAttribute("data-uloginid"),k={},g=!1;"undefined"!==typeof q.uLoginParams&&(q.uLoginParams[d]?k=q.uLoginParams[d]:q.uLoginParams[e]?k=q.uLoginParams[e]:0<this.arrayIntersectKey(q.uLoginParams,this.availableParams).length&&(k=q.uLoginParams,g=!0));b&&(k=this.extend(k,b));var r=a.getAttribute("data-ulogin")||a.getAttribute("x-ulogin-params");
g=null!==r||!g&&0<this.arrayIntersectKey(k,this.availableParams).length;b=this.extend(this.parse(r),k);!e&&!g||d||(d=this.genID(),a.setAttribute("id",d));e?this.getWidget(e,d):g&&this.setProp(d,this.ids.length,b)},inited:function(a){for(var b=0;b<this.ids.length;b++)if(a==this.ids[b].id)return!0;return!1},initWidget:function(a){if(a){var b=this.get(a);if(b&&(b=b.getAttribute("data-ulogin")||b.getAttribute("x-ulogin-params"))&&!this.inited(a)){b=this.parse(b);var d=this.getWidgetNumber(a);isNaN(d)?
d=this.ids.length:this.ids[d]={};this.setProp(a,d,b)}}},setProp:function(a,b,d){if(this.waitGetWidget[a]||this.inited(a))return!1;this.ids[b]={id:a,dropTimer:!1,initCheck:!1,type:d.display||"",providers:d.providers||"",hidden:d.hidden||"",redirect_uri:d.redirect_uri||"",page:this.page,callback:d.callback||"",fields:d.fields||"first_name,last_name,email",force_fields:d.force_fields||"",popup_css:d.popup_css||"",optional:d.optional||"",color:d.color||"fff",opacity:d.opacity||"75",verify:d.verify||"",
m:"undefined"!==typeof d.m?d.m:this.m,lang:d.lang||this.lang,altway:"undefined"!==typeof d.altway?parseInt(d.altway):this.altway,sort:"default"===d.sort?"default":"relevant",state:"",hidden_button:d.hidden_button||"inset",dropdown_container:d.dropdown_container||"body",icons_32:d.icons_32||"",icons_16:d.icons_16||"",theme:d.theme||"classic",client:d.client||"",event:d.event||"click"};-1==this.inArray(this.ids[b].theme,this.themes)&&(this.ids[b].theme=this.themes[0]);this.ids[b].providers||this.ids[b].other||
(this.ids[b].hidden="other");var e;if(this.ids[b].providers){var k=this.ids[b].providers.split(",");var g=[];var r=0;for(e in k){var C=k[e];-1<this.inArray(C,this.providerCodes)?g.push(C):r++}this.ids[b].providers=g.join(",")}if(this.ids[b].hidden&&"other"!==this.ids[b].hidden){k=this.ids[b].hidden.split(",");g=[];for(e in k)C=k[e],-1<this.inArray(C,this.providerCodes)&&g.push(C);this.ids[b].hidden=g.join(",")}if(0<r&&"relevant"===this.ids[b].sort&&"window"!==this.ids[b].type){C=this.ids[b].providers.split(",");
if("other"===this.ids[b].hidden)for(k=0;k<this.providerCodes.filter(Boolean).length&&(g=this.providerCodes.filter(Boolean)[k],-1!==this.inArray(g,C)||(C.push(g),0!==--r));k++);else{g=this.ids[b].hidden.split(",");for(k=0;k<r;k++)C.push(g[0]),g.splice(0,1);this.ids[b].hidden=g.join(",")}this.ids[b].providers=C.filter(Boolean).join(",")}"small"!==this.ids[b].type&&"panel"!==this.ids[b].type||this.sendStats({type:this.ids[b].type});"window"==this.ids[b].type&&!this.ids[b].providers&&this.ids[b].hidden&&
(this.ids[b].providers=this.providerCodes.filter(Boolean).join(","));this.ids[b].mobile=0==d.mobilebuttons?0:this.mobile;this.ids[b].altway&&!this.ids[b].redirect_uri&&(this.ids[b].redirect_uri=location.href);this.ids[b].callback&&!this.ids[b].altway&&(this.ids[b].redirect_uri="");this.ids[b].redirect_uri=this.clearRedirectUri(this.ids[b].redirect_uri);-1==this.inArray(this.ids[b].lang,this.langs)&&(this.ids[b].lang=this.lang);this.ids[b].icons_32=this.fixSiteLink(this.ids[b].icons_32);this.ids[b].icons_16=
this.fixSiteLink(this.ids[b].icons_16);switch(d.display){case "small":case "panel":this.ids[b].listener_id=!1;this.initPanel(b);break;case "window":this.initWindow(b);break;case "buttons":this.initButtons(b);break;default:this.ids.splice(b,b)}this.get(a).setAttribute("data-ulogin-inited",(+new Date).toString())},fixSiteLink:function(a){a&&(/^https?:\/\/(.*?)/.test(a)||(/^\//.test(a)||(a="/"+a),a=location.origin+a),(new RegExp("^"+location.origin)).test(a)||(a="",console.error("uLogin ERROR: resource link is invalid, not match with location.origin")),
a&&(a=this.is_encoded(a)?a.replace(/\//g,"%2F").replace(/\?/g,"%3F"):encodeURIComponent(a)));return a},clearRedirectUri:function(a){if(!a)return a;a=a.replace(/ulogin_callback=([^&?]*?)#/,"#").replace(/ulogin_callback=(.*?)(&|$)/,"").replace(/ulogin_token=([^&?]*?)#/,"#").replace(/ulogin_token=(.*?)(&|$)/,"").replace(/(\?|&)#/,"#").replace(/(\?|&)$/,"");return a=this.is_encoded(a)?a.replace(/\//g,"%2F").replace(/\?/g,"%3F"):encodeURIComponent(a)},initPanel:function(a){var b=this.get(this.ids[a].id),
d="small"==this.ids[a].type?1:0,e=d?21:42,k=d?16:32,g=0,r=d?5:10,C=d?"16px":"32px",E="",D="";this.ids[a].icons_16&&d?E=decodeURIComponent(this.ids[a].icons_16):this.ids[a].icons_32&&!d?E=decodeURIComponent(this.ids[a].icons_32):(D=120<this.getPPI()?d?32:64:d?16:32,E="providers-{size}-{theme}.png?version=img.3.0.2".replace("{size}",D).replace("{theme}",this.ids[a].theme),E=this.buildUrl("version/3.0/img/"+E),D="smiles-{size}.png?version=img.3.0.2".replace("{size}",D).replace("{theme}",this.ids[a].theme),
D=this.buildUrl("img/"+D),this.ids[a].hovered_sprite=D);E="url("+E+") "+(d?"0 -1px":"0 -2px")+" no-repeat";b.innerHTML="";if("other"===this.ids[a].hidden){var N=this.providerCodes.filter(Boolean).slice(0);if(this.ids[a].providers){D=this.ids[a].providers.split(",");for(var G=0;G<D.length;G++){var Q=this.inArray(D[G],N);-1!==Q&&N.splice(Q,1)}}this.ids[a].hidden=N.toString()}if(this.ids[a].providers){D="relevant"===this.ids[a].sort?this.relProviders(this.ids[a].providers,this.ids[a].hidden,1):this.ids[a].providers.split(",");
var O;g+=e*("inset"===this.ids[a].hidden_button&&0<this.ids[a].hidden.length?D.length+1:D.length);e=x.createElement("div");this.ids[a].buttonsContainer=e;this.ids[a].buttonsContainer.className="ulogin-buttons-container";this.resetStyle(e,{width:g,maxWidth:"100%",minHeight:k,verticalAlign:"top",display:"inline-block",lineHeight:0});b.appendChild(e);for(O in D)g=D[O],N=this.inArray(g,this.providerCodes),-1<N&&(e=x.createElement("div"),e.className="ulogin-button-"+g,e.setAttribute("data-uloginbutton",
g),e.setAttribute("role","button"),e.setAttribute("title",this.providerNames[N]),this.resetStyle(e,{"float":"left",width:k,height:k,margin:"0 "+r+"px "+r+"px 0",background:E,cursor:"pointer",backgroundPosition:this.getIconPosition(d,N),backgroundSize:C}),this.ids[a].buttonsContainer.appendChild(e))}this.ids[a].hidden&&(b.style.position="relative","relevant"===this.ids[a].sort&&(this.ids[a].hidden=this.relProviders(this.ids[a].providers,this.ids[a].hidden,2).join(",")),this.ids[a].drop=x.createElement("div"),
this.ids[a].drop.className="ulogin-dropdown-button",this.resetStyle(this.ids[a].drop,{width:k,height:k,margin:"0 "+r+"px "+r+"px 0",cursor:"pointer",background:E,verticalAlign:"baseline",display:"inline-block","float":"none",backgroundSize:C}),this.ids[a].mobile||(this.add(this.ids[a].drop,"mouseover",function(J){uLogin.ids[a].showed=!1;uLogin.dropdownDelayed(a,d?1:2);uLogin.setOpacity(J,uLogin.ids[a].opacity)}),this.add(this.ids[a].drop,"mouseout",function(J){uLogin.ids[a].showed=!0;uLogin.dropdownDelayed(a,
0);uLogin.setOpacity(J)}),this.add(this.ids[a].drop,"click",function(){uLogin.dropdown(a,d?1:2)})),"inset"===this.ids[a].hidden_button&&this.ids[a].buttonsContainer?this.ids[a].buttonsContainer.appendChild(this.ids[a].drop):b.appendChild(this.ids[a].drop),this.ids[a].mobile||this.initDrop(a));this.ids[a].buttonsContainer&&0<this.ids[a].buttonsContainer.clientHeight&&(this.ids[a].buttonsContainer.style.height=this.ids[a].buttonsContainer.clientHeight-r+"px");window.bc=this.ids[a].buttonsContainer;
this.initButtons(a)},initWindow:function(a){var b=this.get(this.ids[a].id),d=b.getElementsByTagName("*");d.length?b=d[0]:b.innerHTML?(d=document.createElement("span"),d.innerHTML=b.innerHTML,b.innerHTML="",b=b.appendChild(d)):(d=x.createElement("img"),d.setAttribute("src",this.buildUrl("img/button.png?version=img.3.0.2")),d.setAttribute("style","cursor:pointer; width:187px; height:30px"),d.setAttribute("alt","\u041c\u0443\u043b\u044c\u0442\u0438\u0412\u0445\u043e\u0434"),b=b.appendChild(d));b.setAttribute("data-uloginbutton",
"window");b.setAttribute("data-ulogin-default","true");this.ids[a].opacity=75;this.initButtons(a)},sendPixel:function(){this.getRC();if(this.pixel){var a=this;K(function(){if(a.pixel){var b=x.createElement("iframe"),d=a.getRC();b.src=a.pixel.replace("[rand]",parseInt(1E5*Math.random())).replace("[u]",encodeURIComponent(location.href)).replace("[r]",encodeURIComponent(x.referrer||""));b.width=b.height=1;b.style.display="none";d.appendChild(b);K(function(){d.removeChild(b)},3E3);a.pixel=!1}},0)}},sendStats:function(a){var b=
{r:parseInt(1E5*Math.random())};a.type&&(b.type=a.type);a=this.buildUrl("stats.html",b);this.initSocket(a,this.getRC())},mergeAccounts:function(a,b){if(!a)return console.error('uLogin ERROR (mergeAccounts): invalid token "'+a+'"'),!1;var d={token:a};b?("undefined"!==typeof b.join&&(b=b.join(",")),d.identities=encodeURIComponent(b),d=this.buildUrl("merge_accounts.php",d)):d=this.buildUrl("require_verify.php",d);this.loadWindow(d)},getRC:function(){var a=document.getElementById("ulogin_receiver_container");
a||(a=x.createElement("div"),a.setAttribute("id","ulogin_receiver_container"),this.resetStyle(a,{width:0,height:0,display:"none"}),x.getElementsByTagName("body")[0].appendChild(a));return a},clearTimeouts:function(){for(var a in this.timeouts)clearTimeout(this.timeouts[a])},callbackTryCall:function(a,b){this.altwayCalled.push(a);q[a]?setTimeout(function(){q[a].call(q,b)},10):setTimeout(function(){uLogin.callbackTryCall(a,b)},100)},callbackReceived:function(){var a=location.search.replace("?","");
if((a=this.parse(a))&&a.ulogin_callback&&a.ulogin_token&&-1===this.inArray(a.ulogin_callback,this.altwayCalled)&&(this.callbackTryCall(a.ulogin_callback,a.ulogin_token),this.supportHistory)){var b=document.getElementsByTagName("title");b=(b=b?b[0]:"")?b.innerHTML:"";delete a.ulogin_callback;delete a.ulogin_token;a=this.buildUrl("",a,!0);var d=location.origin+location.pathname+a+location.hash;K(function(){window.history.pushState({},b,d)},1E3)}},newDialogSocket:function(a){this.dialogSocket&&this.dialogSocket.destroy();
this.dialogSocket=a},initSocket:function(a,b,d,e){e||(e=0);var k=new easyXDM.Socket({remote:a,swf:this.isIE()?this.buildUrl("js/easyxdm.swf"):"",props:{style:this.extend({margin:0,padding:0,background:"#fff",border:0,position:"absolute",left:0,top:0,overflow:"hidden",width:"100%",height:"100%"},d),frameBorder:"0"},container:b,onMessage:function(g){var r;/weights:/.test(g)||console.info("[uLogin] ulogin.js received message: "+g);if(r=g.match(/(.*?)\((.*?)\)/)){var C=r[1];g=r[2]}if(r=g.match(/^(.*?):(.*?)$/)){var E=
r[1];var D=r[2]}/^https?:\/\//.test(g)?location.href=g:/^\/auth.php\?/.test(g)?(g="https://"+uLogin.uLoginHost+g,uLogin.ids[e].altway?location.href=g:uLogin.openWithReceiver(g,e)):-1<uLogin.inArray(g,uLogin.states)?uLogin._changeState(e,g):E&&-1<uLogin.inArray(E,uLogin.states)?uLogin._changeState(e,E,"string"===typeof D?D.split(","):[]):"closeme"==g?(uLogin.hideAll(),k.destroy()):/to_window:/.test(g)?(C=uLogin.buildUrl(g.replace(/to_window:\/?/,"",""),{set:encodeURIComponent("{window:1}")}),uLogin.loadWindow(C),
/to_window:\/fill\.php/.test(g)&&uLogin._changeState(e,"fill")):/weights:/.test(g)?uLogin.setWeights(g.replace(/weights:\/?/,"","")):C?"undefined"!=typeof q[C]&&(q[C].apply(q,g.split(",")),k.destroy(),uLogin.dialog&&uLogin.hideAll()):uLogin.ids[e]&&"undefined"!=typeof q[uLogin.ids[e].callback]&&(uLogin._changeState(e,"receive"),q[uLogin.ids[e].callback](g),uLogin.dialog&&uLogin.hideAll())}});return k},getWidgetNumber:function(a){for(var b=0;b<this.ids.length;b++)if(a==this.ids[b].id)return b;return NaN},
onMoveWindow:function(){this.moveWindow()},loadWindow:function(a,b){null===b&&(b=!1);var d=this.ids[b]?this.ids[b].opacity:75;try{x.body.removeChild(this.lightbox)}catch(k){}try{x.body.removeChild(this.dialog)}catch(k){}var e=x.createElement("div");this.resetStyle(e,{position:"fixed",zIndex:9997,width:"100%",height:"100%",background:"#"+(this.ids[b]?this.ids[b].color:"fff"),display:"none"});this.setOpacity(e,d);this.lightbox=e;e=x.createElement("div");e.id=this.genID();e.className="ulogin-popup";
this.resetStyle(e,{position:"absolute",zIndex:9998,left:Math.floor(this.scrollLeft()+(this.clientWidth()-this.dialogWidth())/2),top:Math.floor(this.scrollTop()+(this.clientHeight()-this.dialogHeight())/2),width:this.dialogWidth(),height:this.dialogHeight(),overflow:"visible",display:"none",border:this.ids[b]&&"flat"===this.ids[b].theme?"5px solid #666":"10px solid #666",borderRadius:this.ids[b]&&"flat"===this.ids[b].theme?0:"8px",boxShadow:"0 2px 3px 0 rgba(0,0,0,.2),0 3px 2px -2px rgba(0,0,0,.22),0 1px 6px 0 rgba(0,0,0,.12)"});
this.dialog=e;e=x.createElement("div");e.className="ulogin-popup-close";this.resetStyle(e,{position:"absolute",width:30,height:30,zIndex:9999,background:"url("+this.buildUrl("img/x.png")+")",cursor:"pointer",display:"none",left:"initial",top:"-15px",right:"-15px"});this.close=e;x.body.appendChild(this.lightbox);x.body.appendChild(this.dialog);this.dialog.appendChild(this.close);this.add(this.lightbox,"click",function(){uLogin.hideAll()});this.add(this.close,"click",function(){uLogin.hideAll()});this.add(this.close,
"mouseover",function(k){k.style.background="url("+uLogin.buildUrl("img/x_.png")+")"});this.add(this.close,"mouseout",function(k){k.style.background="url("+uLogin.buildUrl("img/x.png")+")"});this.add(q,"scroll",function(){uLogin.onMoveWindow()});this.add(q,"resize",function(){uLogin.onMoveWindow()});this.newDialogSocket(this.initSocket(a,this.dialog.getAttribute("id"),{},b));uLogin.show(uLogin.close);uLogin.show(uLogin.lightbox);uLogin.show(uLogin.dialog);uLogin.onMoveWindow()},hideAll:function(){this.hide(this.lightbox);
this.hide(this.dialog);this.hide(this.close);for(var a=0;a<this.ids.length;a++)this.ids[a].showed=!1,this.hide(this.ids[a].hiddenW),this.hide(this.ids[a].hiddenA)},moveWindow:function(){if(!this.dialog||!this.dialog.firstChild)return!1;var a=this.dialogWidth(),b=this.dialogHeight();a=(Math.floor(this.scrollLeft()+(this.clientWidth()-a)/2)-Number(this.dialog.style.left.slice(0,-2)))/10;b=(Math.floor(this.scrollTop()+(this.clientHeight()-b)/2)-Number(this.dialog.style.top.slice(0,-2)))/10;for(var d=
0;10>d;d++)this.dialog.style.left=a+Number(this.dialog.style.left.slice(0,-2))+"px",this.dialog.style.top=b+Number(this.dialog.style.top.slice(0,-2))+"px"},resetStyle:function(a,b){!b&&(b={});var d=this.extend({margin:0,padding:0,outline:"none",border:"none",borderRadius:0,cursor:"default","float":"none",position:"relative",display:"inherit",width:"auto",height:"auto",left:0,top:0,boxSizing:"content-box"},b),e=["width","height","left","top"],k=["float"],g;for(g in d){-1<this.inArray(g,e)&&"number"===
typeof d[g]&&(d[g]+="px");try{-1<this.inArray(g,k)&&a.style.setProperty(g,d[g])}catch(r){}try{a.style[g]=d[g]}catch(r){}}},getIconPosition:function(a,b){return a?"0 -"+(18+17*b)+"px":"0 -"+(36+34*b)+"px"},setOpacity:function(a,b){a.style.filter=b?"alpha(opacity="+b+") progid:DXImageTransform.Microsoft.AlphaImageLoader(src=transparent.png, sizingMethod='crop')":"";a.style.opacity=b?parseFloat(b)/100:""},initDrop:function(a){if(!this.ids[a].mobile&&""!=this.ids[a].hidden){var b=this.get(this.ids[a].id),
d=this.genID();var e=310<23*this.ids[a].hidden.split(",").length-2?310:23*this.ids[a].hidden.split(",").length-2;var k=x.createElement("div");k.className="ulogin-dropdown";k.id=d;this.resetStyle(k,{position:"absolute",zIndex:9999,width:128,height:e,border:"flat"===this.ids[a].theme?"3px solid #666":"5px solid #666",borderRadius:"flat"===this.ids[a].theme?0:"4px",boxShadow:"0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12)",display:"none"});this.ids[a].hiddenW=k;
"body"===this.ids[a].dropdown_container?x.body.appendChild(this.ids[a].hiddenW):b.appendChild(this.ids[a].hiddenW);k=this.buildUrl("/version/3.0/html/drop.html",{id:a,redirect_uri:this.ids[a].redirect_uri,callback:this.ids[a].callback,providers:this.ids[a].hidden,fields:this.ids[a].fields,force_fields:this.ids[a].force_fields,popup_css:this.ids[a].popup_css,optional:this.ids[a].optional,othprov:this.ids[a].providers,protocol:this.protocol,host:this.host,lang:this.ids[a].lang,verify:this.ids[a].verify,
sort:this.ids[a].sort,altway:this.ids[a].altway?1:null,m:this.ids[a].m?1:0,icons_32:this.ids[a].icons_32,icons_16:this.ids[a].icons_16,theme:this.ids[a].theme,client:this.ids[a].client,page:this.page,version:this.version});this.initSocket(k,d,{position:"relative",width:"128px",height:e+"px"},a);k=x.createElement("div");this.resetStyle(k,{position:"absolute",background:"#000",left:"initial",right:"flat"===this.ids[a].theme?"-3px":"-5px",top:"100%",width:41,height:13,border:"flat"===this.ids[a].theme?
"3px solid #666":"5px solid #666",textAlign:"center"});e=x.createElement("a");e.href=this.buildUrl("");e.target="_blank";this.resetStyle(e,{width:41,height:13,background:"url("+this.buildUrl("img/text.png")+") no-repeat"});k.appendChild(e);this.ids[a].hiddenW.appendChild(k);k=x.createElement("div");this.resetStyle(k,{width:0,height:0,position:"absolute",zIndex:9999,display:"none",border:"5px solid transparent",borderBottomColor:"#666"});this.ids[a].hiddenA=k;b.appendChild(this.ids[a].hiddenA);this.ids[a].showed=
!1;this.add(x.body,"click",function(g,r){r.target||(r.target=r.srcElement);for(var C=0;C<uLogin.ids.length;C++)r.target!=uLogin.ids[C].drop&&(uLogin.hide(uLogin.ids[C].hiddenW),uLogin.hide(uLogin.ids[C].hiddenA))});this.ids[a].hiddenW&&this.ids[a].hiddenA&&(this.add(this.ids[a].hiddenW,"mouseout",function(){uLogin.dropdownDelayed(a,0)}),this.add(this.ids[a].hiddenA,"mouseout",function(){uLogin.dropdownDelayed(a,0)}),this.add(this.ids[a].hiddenW,"mouseover",function(){uLogin.clearDropTimer(a)}),this.add(this.ids[a].hiddenA,
"mouseover",function(){uLogin.clearDropTimer(a)}))}},showDrop:function(a,b){if(this.ids[a].hiddenW||this.ids[a].hiddenA)if(this.ids[a].showed||0==b)this.hide(this.ids[a].hiddenW),this.hide(this.ids[a].hiddenA),this.ids[a].showed=!1;else{this.show(this.ids[a].hiddenA);this.show(this.ids[a].hiddenW);this.ids[a].showed=!0;var d=this.ids[a].drop;if("body"===this.ids[a].dropdown_container){var e=this.getOffset(d);var k=e.left;e=e.top;this.ids[a].hiddenW.style.left=k-(1==b?100:106)+"px";this.ids[a].hiddenW.style.top=
e+(1==b?21:37)+"px";this.ids[a].hiddenA.style.left=k+(1==b?4:12)+"px";this.ids[a].hiddenA.style.top=e+(1==b?17:33)+"px"}k=d.offsetLeft;e=d.offsetTop;k-=d.scrollLeft;e-=d.scrollTop;"body"!==this.ids[a].dropdown_container&&(this.ids[a].hiddenW.style.left=k-(1==b?100:106)+"px",this.ids[a].hiddenW.style.top=e+(1==b?21:37)+"px");this.ids[a].hiddenA.style.left=k+(1==b?4:12)+"px";this.ids[a].hiddenA.style.top=e+(1==b?12:28)+"px"}},clearDropTimer:function(a){this.ids[a].dropTimer&&q.clearTimeout(this.ids[a].dropTimer)},
dropdown:function(a,b){this.ids[a].mobile||(this.clearDropTimer(a),this.showDrop(a,b))},dropdownDelayed:function(a,b){this.clearDropTimer(a);this.ids[a].dropTimer=K(function(){uLogin.showDrop(a,b)},600)},initButtons:function(a){var b=this.get(this.ids[a].id);this.ids[a].mobile&&this.add(this.get(this.ids[a].id),"click",function(d,e){e.preventDefault?e.preventDefault():e.returnValue=!1;var k=uLogin.buildUrl("version/3.0/html/mobile.html",{id:uLogin.ids[a].id,redirect_uri:uLogin.ids[a].redirect_uri,
callback:uLogin.ids[a].callback,fields:uLogin.ids[a].fields,force_fields:uLogin.ids[a].force_fields,popup_css:uLogin.ids[a].popup_css,optional:uLogin.ids[a].optional,protocol:uLogin.ids[a].protocol,host:uLogin.host,lang:uLogin.ids[a].lang,verify:uLogin.ids[a].verify,providers:uLogin.ids[a].providers,hidden:uLogin.ids[a].hidden,icons_32:uLogin.ids[a].icons_32,altway:uLogin.ids[a].altway?1:null,page:uLogin.page,m:uLogin.ids[a].m?1:0,icons_16:uLogin.ids[a].icons_16,theme:uLogin.ids[a].theme,client:uLogin.ids[a].client,
version:uLogin.version});uLogin.ids[a].altway?q.top?q.top.location.href=k:location.href=k:uLogin.openWithReceiver(k,a);return!1});"window"===this.ids[a].type?this._proceedChildren(b,this._(this._initButton),a):(this.ids[a].providers="",this._proceedChildren(b,this._(this._initButton),a),this.ids[a].providers=this.ids[a].providers.slice(0,this.ids[a].providers.length-1));this._changeState(a,this.states[0])},_:function(a){return function(){a.apply(uLogin,arguments)}},_proceedChildren:function(a,b,d){a=
a.childNodes;var e,k;for(k=0;k<a.length;k++){var g=a[k];g.getAttribute&&(b(g,d),(e=g.getAttribute("data-uloginbutton")||g.getAttribute("x-ulogin-button"))&&-1<this.inArray(e,this.providerCodes)&&!(new RegExp(e+"(,|$)","i")).test(this.ids[d].providers)&&(this.ids[d].providers+=e+","));this._proceedChildren(g,b,d)}},_initButton:function(a,b){var d=a.getAttribute("data-uloginbutton")||a.getAttribute("x-ulogin-button");if(d)if(-1<this.inArray(d,this.providerCodes))this.add(a,"mouseover",function(g){if(/disabled/.test(g.className))return!1;
uLogin.setOpacity(g,parseFloat(uLogin.ids[b].opacity));if(+new Date<+new Date("2017/04/02 03:00:00")&&uLogin.ids[b].hovered_sprite&&!g.getAttribute("data-original-background")){var r=g.offsetHeight*uLogin.randFromTo(0,24),C="ru"===uLogin.ids[b].lang?"1 \u0430\u043f\u0440\u0435\u043b\u044f - \u0434\u0435\u043d\u044c \u0441\u043c\u0435\u0445\u0430! \u0423\u043b\u044b\u0431\u0430\u0439\u0442\u0435\u0441\u044c )":"April Fools' Day is here!";g.setAttribute("data-original-background",g.style.background);
g.style.background="url("+uLogin.ids[b].hovered_sprite+") 0px -"+r+"px no-repeat";g.setAttribute("data-original-title",g.getAttribute("title"));g.setAttribute("title",C)}}),this.add(a,"mouseout",function(g){if(/disabled/.test(g.className))return!1;uLogin.setOpacity(g);g.getAttribute("data-original-background")&&(g.style.background=g.getAttribute("data-original-background"),g.removeAttribute("data-original-background"));g.getAttribute("data-original-title")&&(g.setAttribute("title",g.getAttribute("data-original-title")),
g.removeAttribute("data-original-title"))}),this.ids[b].mobile||this.add(a,"click",function(g){if(/disabled/.test(g.className))return!1;var r=g.getAttribute("data-uloginbutton")||g.getAttribute("x-ulogin-button");if(g.getAttribute("data-disabled-click"))return!1;g.setAttribute("data-disabled-click","1");setTimeout(function(){g.setAttribute("data-disabled-click","")},1E3);uLogin.startAuth(r,"",b)});else if("window"===d&&(this.ids[b].mobile||this.add(a,this.ids[b].event,function(g,r){r.preventDefault?
r.preventDefault():r.returnValue=!1;if(/disabled/.test(g.className))return!1;var C=uLogin.buildUrl(uLogin.ids[b].mobile?"version/3.0/html/mobile.html":"version/3.0/html/window.html",{id:b,redirect_uri:uLogin.ids[b].redirect_uri,callback:uLogin.ids[b].callback,fields:uLogin.ids[b].fields,force_fields:uLogin.ids[b].force_fields,popup_css:uLogin.ids[b].popup_css,optional:uLogin.ids[b].optional,protocol:uLogin.protocol,host:uLogin.host,lang:uLogin.ids[b].lang,verify:uLogin.ids[b].verify,sort:uLogin.ids[b].sort,
othprov:uLogin.ids[b].hidden,providers:uLogin.ids[b].providers,altway:uLogin.ids[b].altway?1:null,m:uLogin.ids[b].m?1:0,icons_32:uLogin.ids[b].icons_32,icons_16:uLogin.ids[b].icons_16,theme:uLogin.ids[b].theme,client:uLogin.ids[b].client,page:uLogin.page,version:uLogin.version});uLogin.loadWindow(C,b);return!1}),a.getAttribute("data-ulogin-default"))){var e=this.buildUrl("img/"+("ru"==this.ids[b].lang?"":this.ids[b].lang+"/")+"button.png?version=img.3.0.2"),k=this.buildUrl("img/"+("ru"==this.ids[b].lang?
"":this.ids[b].lang+"/")+"button_.png?version=img.3.0.2");a.src=e;this.resetStyle(a,{cursor:"pointer"});this.add(a,"mouseover",function(g){if(/disabled/.test(g.parentNode.className))return!1;g.src!=k&&(g.src=k)});this.add(a,"mouseout",function(g){if(/disabled/.test(g.parentNode.className))return!1;g.src!=e&&(g.src=e)})}},randFromTo:function(a,b){return Math.floor(Math.random()*b)+a},sendWeight:function(a){this.initSocket(this.buildUrl("version/3.0/html/weight_set.html",{provider:a,r:parseInt(1E5*
Math.random())}),this.getRC(),{background:"transparent"})},setWeights:function(a){this.supportStorage&&(localStorage.providers_weight=a)},getWeights:function(){try{return JSON.parse(localStorage.providers_weight)}catch(a){return{}}},relProviders:function(a,b,d){a=a.split(",");b=b.split(",");if(this.supportStorage){var e=this.getWeights(),k;for(k in e){e=this.inArray(k,a);var g=this.inArray(k,b);-1!==e?(a.splice(e,1),a.splice(0,0,k)):-1!==g&&(a.splice(0,0,k),b.splice(g,1),b.splice(0,0,a[a.length-1]),
a.splice(a.length-1,1))}}return 1===d?a:b},startAuth:function(a,b,d){var e={name:a,window:1,lang:this.ids[d].lang,fields:this.ids[d].fields,force_fields:this.ids[d].force_fields,popup_css:this.ids[d].popup_css,host:this.host,optional:this.ids[d].optional,redirect_uri:this.ids[d].redirect_uri||location.href,verify:this.ids[d].verify,callback:this.ids[d].callback,screen:screen.width+"x"+screen.height,url:b,providers:this.ids[d].providers,hidden:this.ids[d].hidden,m:this.ids[d].m?1:0,page:this.page,
icons_32:this.ids[d].icons_32,icons_16:this.ids[d].icons_16,theme:this.ids[d].theme,client:this.ids[d].client,version:this.version};this.ids[d].altway&&(e.altway=1);a=b||"webmoney"!=a&&"livejournal"!=a&&"openid"!=a?this.buildUrl("auth.php",e):this.buildUrl("url.php",e);this._changeState(d,this.states[1]);this.ids[d].altway?q.top?q.top.location.href=a:location.href=a:this.openWithReceiver(a,d)},openWithReceiver:function(a,b){!b&&(b=0);var d=660,e=420;/name=vkontakte/.test(a)?e=380:/name=facebook/.test(a)?
(d=560,e=350):/name=google/.test(a)?(d=800,e=630):/name=yandex/.test(a)?(d=990,e=530):/name=lastfm/.test(a)&&(d=1368,e=894);this.openFromSocket?this.authSocket.postMessage("window.open::"+a+"::"+d+"::"+e+"::"+(screen.width-d)/2+"::"+(screen.height-e)/2):(this.initSocket(this.buildUrl("/version/3.0/html/buttons_receiver.html",{four:encodeURIComponent(a),r:parseInt(1E5*Math.random())}),this.getRC(),{background:"transparent"},b),uLogin.getRC().getElementsByTagName("iframe"),window.open(a,"uLogin_window",
"width="+d+",height="+e+",left="+(screen.width-d)/2+",top="+(screen.height-e)/2))},checkWindow:function(a,b){},checkCurrentWidgets:function(){for(var a=0;this.ids[a];)this.checkWidget(this.ids[a++].id)},checkWidget:function(a,b){var d=this.get(a);if(d)if(this.inited(a)){var e=this.getWidgetNumber(a),k=this.ids[e].type;if(("small"===k||"panel"===k)&&!d.childNodes.length)return d=this.ids[e].id,uLogin.ids[e].id=!1,uLogin.initWidget(d),!0;d.getAttribute("data-ulogin-inited")||(d=this.ids[e].id,uLogin.ids[e].id=
!1,uLogin.initWidget(d))}else this.addWidget(this.get(a),b);else this.ids[this.getWidgetNumber(a)].id=!1},buildUrl:function(a,b,d){b||(b={});d||(d=!1);a=a?"https://"+this.uLoginHost+"/"+a:"";var e="",k;for(k in b){var g=b[k];null!==g&&(!d&&(/\?/.test(g)||/\//.test(g)||/:/.test(g))&&(g=""),e+=k+"="+g+"&")}0<e.length&&(e=e.substring(0,e.length-1),a=a+(/\?/.test(a)?"&":"?")+e);return a},getWidget:function(a,b){if(this.inited(b))return!1;if(this.widgetSettings[a])return this.setProp(b,uLogin.ids.length,
this.widgetSettings[a]),!1;if(this.waitGetWidget[a]&&-1!==this.inArray(b,this.waitGetWidget[a]))return!1;this.waitGetWidget[a]||(this.waitGetWidget[a]=[]);this.waitGetWidget[a].push(b);if(this.widgetSettings[a])this.setProp(b,this.ids.length,this.widgetSettings[a]);else{var d=this.getRC(),e=x.createElement("script");e.async=!0;e.src=this.buildUrl("getwidget",{widgetid:a});d.appendChild(e)}},forElements:function(a,b){if(a&&a.length)for(var d in a)b(a[d])},setWidget:function(a,b,d){!d&&b&&(d=b);if("not_found"===
a)return this.forElements(this.waitGetWidget[a],function(e){if("string"!==typeof e)return!1;x.getElementById(e).setAttribute("data-uloginid","")}),!1;d&&!uLogin.widgetSettings[a]&&"undefined"!==typeof d.display&&(this.forElements(this.waitGetWidget[a],function(e){if("string"!==typeof e)return!1;var k=x.getElementById(e);if(!k)return console.error('uLogin ERROR: not found element with id "'+e+'"'),!1;k=uLogin.parse(k.getAttribute("data-ulogin"));for(var g in k)d[g]=k[g];uLogin.setProp(e,uLogin.ids.length,
d)}),this.widgetSettings[a]=d)},customInit:function(){for(var a=0;a<arguments.length;a++)if("string"===typeof arguments[a]){var b=!1;if(!uLogin.get(arguments[a])||!arguments[a])return console.error('uLogin ERROR (customInit): Element with ID="'+arguments[a]+'" not found'),!1;1<arguments.length&&"object"===typeof arguments[arguments.length-1]&&(b=arguments[arguments.length-1]);uLogin.checkWidget(arguments[a],b)}},getOffsetSum:function(a){for(var b=0,d=0;a;)b+=parseFloat(a.offsetTop),d+=parseFloat(a.offsetLeft),
a=a.offsetParent;return{top:Math.round(b),left:Math.round(d)}},getOffsetRect:function(a){a=a.getBoundingClientRect();var b=document.body,d=document.documentElement;return{top:Math.round(a.top+(window.pageYOffset||d.scrollTop||b.scrollTop)-(d.clientTop||b.clientTop||0)),left:Math.round(a.left+(window.pageXOffset||d.scrollLeft||b.scrollLeft)-(d.clientLeft||b.clientLeft||0))}},getOffset:function(a){return a.getBoundingClientRect?this.getOffsetRect(a):this.getOffsetSum(a)},checkAsyncWidgets:function(){var a=
this.get("ulogin")||this.get("uLogin");a&&a.id&&this.addWidget(a)},setStateListener:function(a,b,d){this.listeners[a]||(this.listeners[a]={});this.listeners[a][b]||(this.listeners[a][b]=[]);return this.listeners[a][b].push(d)-1},removeStateListener:function(a,b,d){return this.listeners[a]&&this.listeners[a][d]?this.listeners[a][d].splice(b,1):!1},_changeState:function(a,b,d){try{this.ids[a].state=b;for(var e=0;this.listeners[this.ids[a].id][b][e];)this.listeners[this.ids[a].id][b][e++].apply(q,"object"===
typeof d?d:[])}catch(k){}},extend:function(a,b){for(var d in b)a[d]=b[d];return a},arrayIntersectKey:function(a,b){var d=[],e;for(e in a)e in b&&d.push(e);return d}},-1==uLogin.inArray(uLogin.lang,uLogin.langs)&&(uLogin.lang=uLogin.langs[0]),uLogin.init("undefined"!=typeof uLogin_query?uLogin_query:""));q.receiver=function(a,b,d){uLogin._changeState(0,"receive",[a]);!d&&b&&(d=b);q[d](a)};q.redirect=function(a,b){var d=x.createElement("form");d.action=b;d.method="post";d.target="_top";d.style.display=
"none";var e=x.createElement("input");e.type="hidden";e.name="token";e.value=a;d.appendChild(e);x.body.appendChild(d);d.submit()}})(window,document,navigator,setTimeout);
